From: Florian Müllner Date: Sat, 29 Nov 2014 00:25:04 +0000 (+0000) Subject: app: Use StIcon as icon_texture when loading from a GIcon X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1949 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0acc7ed4c2d681ba31e9e04c5c08c288a8e2b2a2;p=gnome-shell.git app: Use StIcon as icon_texture when loading from a GIcon Themes - namely the HighContrast one - may now request symbolic icons rather than fullcolor ones. In order to have recoloring work as expected in that case, we will need a theme node to pick up colors from - using an StIcon instead of manually loading a texture from the cache gives us that for free, so do that. https://bugzilla.gnome.org/show_bug.cgi?id=740447 --- diff --git a/src/shell-app.c b/src/shell-app.c index a16ef5c8f..2d98eb41a 100644 --- a/src/shell-app.c +++ b/src/shell-app.c @@ -209,27 +209,23 @@ shell_app_create_icon_texture (ShellApp *app, int size) { GIcon *icon; - gint scale; ClutterActor *ret; - ShellGlobal *global; - StThemeContext *context; - - global = shell_global_get (); - context = st_theme_context_get_for_stage (shell_global_get_stage (global)); - g_object_get (context, "scale-factor", &scale, NULL); - ret = NULL; if (app->info == NULL) return window_backed_app_get_icon (app, size); + ret = st_icon_new (); + st_icon_set_icon_size (ST_ICON (ret), size); + icon = g_app_info_get_icon (G_APP_INFO (app->info)); if (icon != NULL) - ret = st_texture_cache_load_gicon (st_texture_cache_get_default (), NULL, icon, size, scale); - - if (ret == NULL) + { + st_icon_set_gicon (ST_ICON (ret), icon); + } + else { icon = g_themed_icon_new ("application-x-executable"); - ret = st_texture_cache_load_gicon (st_texture_cache_get_default (), NULL, icon, size, scale); + st_icon_set_gicon (ST_ICON (ret), icon); g_object_unref (icon); }